<template>
	<layout :loading="loading" curPage="monitoringFacilities" title="监控设施基本情况">
		
		<block slot="title">
			<authNav href="/pages/monitoringFacilities/monitoringFacilitiesEdit" url="/admin/monitoringFacilities/save" class="layui-btn layui-btn-sm">
				<i class="layui-icon layui-icon-add-1"></i>
				添加
			</authNav>
		</block>
		
		<conditions :list="conditonList" :conditions="conditions" @submit="submitSearch"></conditions>

		<div class="layui-form layui-border-box layui-table-view">

			<tableList :list="page.list" :canSelect="false">

				<block slot="head">
					<th>站房面积</th>
					<th>门禁方式</th>
					<th>网络运营商</th>
					<th>存储IP</th>
					<th>排口视频监控ip/编码</th>
					<th>站房视频监控ip/编码</th>
					<th>治污设施视频监控ip/编码</th>
					<th>其他视频监控 ip/编码</th>
					<th>废水留样装置型号</th>
					<th>生产商</th>
					<th>监管部门</th>
					<th>行业</th>
					<th>点位名称</th>
					<th>企业名称</th>
					<th>运维人员</th>
					<th class="autoWidth">运维公司</th>
					<th>操作</th>
				</block>

				<block slot="body">

					<tr v-for="( x , index) in page.list" :key="index">
						<td>
							{{x.area}}㎡
						</td>
						<td>
							{{x.controlMode}}
						</td>
						<td>
							{{x.newworkOperator}}
						</td>
						<td>
							{{x.ip}}
						</td>
						<td>
							{{x.platoonIp}}
						</td>
						<td>
							{{x.stationIp}}
						</td>
						<td>
							{{x.polutionIp}}
						</td>
						<td>
							{{x.otherIp}}
						</td>
						<td>
							{{x.sampleNo}}
						</td>
						<td>
							{{x.manufacture}}
						</td>
						<td>
							{{x.regulatoryAuthorities}}
						</td>
						<td>
							{{x.industry}}
						</td>
						<td>
							{{x.name}}
						</td>
						<td>
							{{x.companyName}}
						</td>
						<td>
							{{x.staffName1}}
						</td>
						<td>
							{{x.servicerName2}}
						</td>
						<td>
							<authNav :href="'/pages/monitoringFacilities/monitoringFacilitiesEdit?id=' + x.id" url="/admin/monitoringFacilities/save" class="layui-btn layui-btn-xs">
								编辑
							</authNav>
							<authBtn :url="'/admin/monitoringFacilities/delete?id='+x.id" confirm="delete" class="layui-btn layui-btn-xs">
								删除
							</authBtn>
						</td>
					</tr>

				</block>

			</tableList>
			
			<emptyTips :loading="loading" :list="page.list"></emptyTips>

			<paginate :page="page" @switchPage="switchPage" @changePageSize="changePageSize"></paginate>
			
		</div>


	</layout>
</template>

<script>
	export default {
		data() {
			return {
				conditonList:[
					{title:"点位",name:"tmf.stationId",type:"bigint"},
					{title:"点位名称",name:"ts.name",type:"varchar"},
					{title:"企业名称",name:"tc.name",type:"varchar"},
					{title:"运维公司",name:"tsr.name",type:"varchar"}
				],
				conditions: {},
				loading: true ,
				action: "/admin/monitoringFacilities/list",
				page: {
					pageNumber: 1,
					lastPage: true,
					totalPage: 1,
					list: [],
					totalRow: 0,
					pageSize: 10
				}
			}
		},
		
		onLoad:function(res){
			this.conditions = res || {} ;
		},

		onShow() {
			this.kit.getPage(this.action,function(res){
			});
		},

		methods: {
			submitSearch:function(conditions){
				this.conditions = conditions ;
				this.switchPage(1);
			},
			
			switchPage: function(pageNumber) {
				this.page.pageNumber = pageNumber || this.page.pageNumber ;
				this.kit.getPage(this.action);
			},
			
			changePageSize: function(pageSize) {
				this.page.pageSize = pageSize;
				this.page.pageNumber = 1;
				this.kit.getPage(this.action);
			},
		}
	}
</script>